<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ArduinoDistanceSensorLibrary: UltrasonicDistanceSensor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ArduinoDistanceSensorLibrary
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_ultrasonic_distance_sensor.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_ultrasonic_distance_sensor-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">UltrasonicDistanceSensor Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for UltrasonicDistanceSensor:</div>
<div class="dyncontent">
<div class="center"><img src="class_ultrasonic_distance_sensor__inherit__graph.png" border="0" usemap="#_ultrasonic_distance_sensor_inherit__map" alt="Inheritance graph"/></div>
<map name="_ultrasonic_distance_sensor_inherit__map" id="_ultrasonic_distance_sensor_inherit__map">
<area shape="rect" id="node5" href="class_distance_s_r_f04.html" title="{DistanceSRF04\n||+ DistanceSRF04()\l+ getDistanceTime()\l}" alt="" coords="23,395,164,498"/><area shape="rect" id="node2" href="class_distance_sensor.html" title="{DistanceSensor\n|# _average\l|+ isCloser()\l+ isFarther()\l+ setAveraging()\l}" alt="" coords="35,5,152,125"/></map>
</div>
<div class="dynheader">
Collaboration diagram for UltrasonicDistanceSensor:</div>
<div class="dyncontent">
<div class="center"><img src="class_ultrasonic_distance_sensor__coll__graph.png" border="0" usemap="#_ultrasonic_distance_sensor_coll__map" alt="Collaboration graph"/></div>
<map name="_ultrasonic_distance_sensor_coll__map" id="_ultrasonic_distance_sensor_coll__map">
<area shape="rect" id="node2" href="class_distance_sensor.html" title="{DistanceSensor\n|# _average\l|+ isCloser()\l+ isFarther()\l+ setAveraging()\l}" alt="" coords="35,5,152,125"/></map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4f1e093a30c101b8ec225a2970712d58"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4f1e093a30c101b8ec225a2970712d58"></a>
virtual int&#160;</td><td class="memItemRight" valign="bottom"><b>getDistanceTime</b> ()=0</td></tr>
<tr class="memitem:a936da791e81d90e386850913cbcbab29"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a936da791e81d90e386850913cbcbab29"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ultrasonic_distance_sensor.html#a936da791e81d90e386850913cbcbab29">begin</a> ()</td></tr>
<tr class="memdesc:a936da791e81d90e386850913cbcbab29"><td class="mdescLeft">&#160;</td><td class="mdescRight">Begin function to set default pins. <br/></td></tr>
<tr class="memitem:a771d720e7d6b20e0e303e4a1fd411095"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ultrasonic_distance_sensor.html#a771d720e7d6b20e0e303e4a1fd411095">begin</a> (int echoPin, int trigPin)</td></tr>
<tr class="memitem:aa8093d0c333e6ce180f1708ca99ae2c1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa8093d0c333e6ce180f1708ca99ae2c1"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ultrasonic_distance_sensor.html#aa8093d0c333e6ce180f1708ca99ae2c1">getDistanceCentimeter</a> ()</td></tr>
<tr class="memdesc:aa8093d0c333e6ce180f1708ca99ae2c1"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_ultrasonic_distance_sensor.html#aa8093d0c333e6ce180f1708ca99ae2c1" title="getDistanceCentimeter(): Returns the distance in centimeters">getDistanceCentimeter()</a>: Returns the distance in centimeters <br/></td></tr>
<tr class="memitem:a3a8b89cb52091f36dd87ed6afff9617a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3a8b89cb52091f36dd87ed6afff9617a"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_ultrasonic_distance_sensor.html#a3a8b89cb52091f36dd87ed6afff9617a">getDistanceInch</a> ()</td></tr>
<tr class="memdesc:a3a8b89cb52091f36dd87ed6afff9617a"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_ultrasonic_distance_sensor.html#a3a8b89cb52091f36dd87ed6afff9617a" title="getDistanceInch(): Returns the distance in inches">getDistanceInch()</a>: Returns the distance in inches <br/></td></tr>
<tr class="inherit_header pub_methods_class_distance_sensor"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_distance_sensor')"><img src="closed.png" alt="-"/>&nbsp;Public Member Functions inherited from <a class="el" href="class_distance_sensor.html">DistanceSensor</a></td></tr>
<tr class="memitem:aaeb8f74df2282153123c30e07c775724 inherit pub_methods_class_distance_sensor"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aaeb8f74df2282153123c30e07c775724"></a>
boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_distance_sensor.html#aaeb8f74df2282153123c30e07c775724">isCloser</a> (int threshold)</td></tr>
<tr class="memdesc:aaeb8f74df2282153123c30e07c775724 inherit pub_methods_class_distance_sensor"><td class="mdescLeft">&#160;</td><td class="mdescRight">isCloser: check whether the distance to the detected object is smaller than a given threshold <br/></td></tr>
<tr class="memitem:a4135f6f4c351c5f0d001dbedab118dc4 inherit pub_methods_class_distance_sensor"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a4135f6f4c351c5f0d001dbedab118dc4"></a>
boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_distance_sensor.html#a4135f6f4c351c5f0d001dbedab118dc4">isFarther</a> (int threshold)</td></tr>
<tr class="memdesc:a4135f6f4c351c5f0d001dbedab118dc4 inherit pub_methods_class_distance_sensor"><td class="mdescLeft">&#160;</td><td class="mdescRight">isFarther: check whether the distance to the detected object is bigger than a given threshold <br/></td></tr>
<tr class="memitem:a77ec007235ec2e52d0e74507ec6afbc6 inherit pub_methods_class_distance_sensor"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77ec007235ec2e52d0e74507ec6afbc6"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_distance_sensor.html#a77ec007235ec2e52d0e74507ec6afbc6">setAveraging</a> (int avg)</td></tr>
<tr class="memdesc:a77ec007235ec2e52d0e74507ec6afbc6 inherit pub_methods_class_distance_sensor"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_distance_sensor.html#a77ec007235ec2e52d0e74507ec6afbc6" title="setAveraging(int avg): Sets how many samples have to be averaged in getDistanceCentimeter, default value is 1.">setAveraging(int avg)</a>: Sets how many samples have to be averaged in getDistanceCentimeter, default value is 1. <br/></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a60452f845c3a47673212e2cabb80c862"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a60452f845c3a47673212e2cabb80c862"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_trigPin</b></td></tr>
<tr class="memitem:a2a7b494306ba0f88dc6a9151d9a5d0e3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2a7b494306ba0f88dc6a9151d9a5d0e3"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_echoPin</b></td></tr>
<tr class="inherit_header pro_attribs_class_distance_sensor"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_distance_sensor')"><img src="closed.png" alt="-"/>&nbsp;Protected Attributes inherited from <a class="el" href="class_distance_sensor.html">DistanceSensor</a></td></tr>
<tr class="memitem:af58f6a161dff2f02fd65b26eed200460 inherit pro_attribs_class_distance_sensor"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af58f6a161dff2f02fd65b26eed200460"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>_average</b></td></tr>
</table>
<h2>Member Function Documentation</h2>
<a class="anchor" id="a771d720e7d6b20e0e303e4a1fd411095"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void UltrasonicDistanceSensor::begin </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>echoPin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>trigPin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Begin variables</p>
<ul>
<li>int trigPin: pin used to activate the sensor</li>
<li>int echoPin: pin used to read the reflection </li>
</ul>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_ultrasonic_distance_sensor.html">UltrasonicDistanceSensor</a></li>
    <li class="footer">Generated on Tue Dec 25 2012 03:39:35 for ArduinoDistanceSensorLibrary by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.2 </li>
  </ul>
</div>
</body>
</html>
